﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace KHOALUAN
{
    public partial class frmGridView : Form
    {
        public string strCode = "";
        public string strText = "";
        public frmGridView()
        {
            InitializeComponent();
        }

        private void frmGridView_Load(object sender, EventArgs e)
        {
            clsMain.cls.KhoiTaoFormControls(clsMain.FormGridView, dgv);
        }
        private void frmGridView_VisibleChanged(object sender, EventArgs e)
        {
            if (this.Visible == false)
            {
                clsMain.cls.FormGridViewClosing(strCode,strText);
            }
        }

        private void frmGridView_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode.Equals(System.Windows.Forms.Keys.Escape))
            {
                this.Visible = false;
            }
        }
        private void dgv_MouseDoubleClick(object sender, EventArgs e)
        {
            strCode = dgv.dgv.SelectedCells[0].Value.ToString();
            strText = dgv.dgv.SelectedCells[1].Value.ToString();
            this.Visible = false;
        }
    }
}
